package com.study.living.camera;

import android.util.Size;

public class SmartSize {

    private final int width;
    private final int height;

    private Size size;

    public SmartSize(int width, int height) {
        this.width = width;
        this.height = height;
    }

    public SmartSize(Size size) {
        this.size = size;
        this.width = size.getWidth();
        this.height = size.getHeight();
    }

    public int getHeight() {
        return height;
    }

    public int getWidth() {
        return width;
    }

    public int getBig(){
        return Math.max(width, height);
    }

    public int getSmall(){
        return Math.min(width, height);
    }

    public Size getSize() {
        if (size == null){
            size = new Size(width, height);
        }
        return size;
    }

    @Override
    public String toString() {
        return "SmartSize{" +
                "width=" + width +
                ", height=" + height +
                '}';
    }
}
